#pragma  once

#include "BasicType.h"
#include "Pool.h"
#include "Stream.h"

#include "Character.h"
#include "Shape.h"
#include "SpriteDef.h"
#include "Bitmap.h"
#include "Font.h"
#include "StaticText.h"



namespace LightPlayer {


	struct dictionaryCharacterInfo{
		eCharacterType		CharacterType;
		Character*			pCharacter;

		dictionaryCharacterInfo(eCharacterType _Type = eShapeCharacter, Character* _pCharacter = NULL ){
			CharacterType = _Type; pCharacter = _pCharacter;
		} 
	};

	class CharacterList {
		// pools
		pool<Shape>										m_shapes;
		pool<SPRITE_DEFINITION>							m_Sprites;
		pool<Bitmap>									m_Bitmaps;
		pool<Font>										m_Fonts;
		pool<StaticText>								m_StaticTexts;
		// dico
		dictionary<uint16,dictionaryCharacterInfo>		m_dictionary;
	public:

		CharacterList();
		void init();

		Character*				getCharacter(uint16 characterId);
		Shape*					getShape(uint16 characterId);
		SPRITE_DEFINITION*		getSprite(uint16 characterId);
		Bitmap*					getBitmap(uint16 characterId);
		Font*					getFont(uint16 characterId);
		StaticText*				getStaticText(uint16 characterId);

		void					StoreShapeInDictionary( Shape* shape );
		void					StoreSpriteInDictionary( SPRITE_DEFINITION* sprite );
		void					StoreBitmapInDictionary( Bitmap* bitmap );
		void					StoreFontInDictionary( Font* font );
		void					StoreStaticTextInDictionary( StaticText* text );
		

		Shape*					createShapeDef();
		SPRITE_DEFINITION*		createSpriteDef();
		Bitmap*					createBitmapDef();
		Font*					createFontDef();
		StaticText*				createStaticTextDef();
		
	};
};